package com.wuqi.dev.logindemo;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Risky57 on 2017/4/21.
 */

public class TokenUtil {

    public static void saveToken(Context context, String token){
        SharedPreferences shared = context.getSharedPreferences("com.xx.xx.TOKEN", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = shared.edit();
        editor.putString("token", token);
        editor.apply();

    }

    public static String getToken(Context context){
        SharedPreferences shared = context.getSharedPreferences("com.xx.xx.TOKEN", Context.MODE_PRIVATE);
        return shared.getString("token", null);
    }
}
